package com.socket;

import java.io.DataInputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class SocketService {
	public static void main(String[] arg) throws Exception{
		ServerSocket sk = new ServerSocket(5005);
		Socket s = sk.accept();
		DataInputStream dis = new DataInputStream(s.getInputStream());
		String str = null;
		//System.out.println("xxx");
		while(!"bye".equals(str = dis.readUTF())){
			System.out.println(str);
	
		}
		
		dis.close();
		s.close();


	}
}
